#include"producer.hh"
#include"Task_queue.hh"
#include<stdlib.h>
#include<time.h>
#include<iostream>
#include<thread>
#include<chrono>

using std::cout;
using std::endl;
using std::this_thread::sleep_for;

void Producer::push(Taskqueue& rhs)
{
    ::srand(::time(NULL));
    //::srand(::clock());
    
    for(int i=0 ;i<20;++i)
    {
        int proceed=rand()%101;
        rhs.push(proceed);
        //加锁输出
        cout<<">> push proceed = "<<proceed<<endl;
        /* sleep_for(std::chrono::seconds(1)); */
    }
}
